//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.salesperson.commission;

import java.io.Serializable;
import java.math.BigDecimal;

public class Commission
        implements Serializable {

    public Commission() {
    }

    public Commission(Integer id, Integer commerciauxId, String articleId, String debut, String fin, BigDecimal t, String updateUserId,
            String updateTime) {
        setId(id);
        setCommerciauxId(commerciauxId);
        setArticleId(articleId);
        setDebut(debut);
        setFin(fin);
        setT(t);
        setUpdateUserId(updateUserId);
        setUpdateTime(updateTime);
    }

    public Commission(Commission otherData) {
        setId(otherData.getId());
        setCommerciauxId(otherData.getCommerciauxId());
        setArticleId(otherData.getArticleId());
        setDebut(otherData.getDebut());
        setFin(otherData.getFin());
        setT(otherData.getT());
        setUpdateUserId(otherData.getUpdateUserId());
        setUpdateTime(otherData.getUpdateTime());
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setCommerciauxId(Integer commerciauxId) {
        this.commerciauxId = commerciauxId;
    }

    public Integer getCommerciauxId() {
        return commerciauxId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public String getArticleId() {
        return articleId;
    }

    public void setDebut(String debut) {
        this.debut = debut;
    }

    public String getDebut() {
        return debut;
    }

    public void setFin(String fin) {
        this.fin = fin;
    }

    public String getFin() {
        return fin;
    }

    public void setT(BigDecimal t) {
        this.t = t;
    }

    public BigDecimal getT() {
        return t;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "commerciauxId=" + getCommerciauxId() + " " + "articleId=" + getArticleId() + " " + "debut=" + getDebut() + " " + "fin=" + getFin() + " " + "t=" + getT() + " " + "updateUserId=" + getUpdateUserId() + " " + "updateTime=" + getUpdateTime());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Commission) {
            Commission lTest = (Commission) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (commerciauxId == null) {
                lEquals = lEquals && lTest.commerciauxId == null;
            } else {
                lEquals = lEquals && commerciauxId.equals(lTest.commerciauxId);
            }
            if (articleId == null) {
                lEquals = lEquals && lTest.articleId == null;
            } else {
                lEquals = lEquals && articleId.equals(lTest.articleId);
            }
            if (debut == null) {
                lEquals = lEquals && lTest.debut == null;
            } else {
                lEquals = lEquals && debut.equals(lTest.debut);
            }
            if (fin == null) {
                lEquals = lEquals && lTest.fin == null;
            } else {
                lEquals = lEquals && fin.equals(lTest.fin);
            }
            if (t == null) {
                lEquals = lEquals && lTest.t == null;
            } else {
                lEquals = lEquals && t.equals(lTest.t);
            }
            if (updateUserId == null) {
                lEquals = lEquals && lTest.updateUserId == null;
            } else {
                lEquals = lEquals && updateUserId.equals(lTest.updateUserId);
            }
            if (updateTime == null) {
                lEquals = lEquals && lTest.updateTime == null;
            } else {
                lEquals = lEquals && updateTime.equals(lTest.updateTime);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (commerciauxId == null ? 0 : commerciauxId.hashCode());
        result = 37 * result + (articleId == null ? 0 : articleId.hashCode());
        result = 37 * result + (debut == null ? 0 : debut.hashCode());
        result = 37 * result + (fin == null ? 0 : fin.hashCode());
        result = 37 * result + (t == null ? 0 : t.hashCode());
        result = 37 * result + (updateUserId == null ? 0 : updateUserId.hashCode());
        result = 37 * result + (updateTime == null ? 0 : updateTime.hashCode());
        return result;
    }
    private Integer id;
    private Integer commerciauxId;
    private String articleId;
    private String debut;
    private String fin;
    private BigDecimal t;
    private String updateUserId;
    private String updateTime;
}
